import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (page, pagesize) => request.get('/sys/role', {
  params: {
    page,
    pagesize
  }
})

// 新增角色列表
export const postRoleList = data => request.post('/sys/role', data)

// 删除角色
export const deleteRole = id => request.delete(`/sys/role/${id}`)

// 修改角色
export const putRole = data => request.put(`/sys/role/${data.id}`, data)

// 获取角色详情
export const getRoleDetail = id => request.get(`/sys/role/${id}`)

// 角色分配权限
export const putRolePermission = (permIds, id) => request.put('/sys/role/assignPrem', {
  permIds,
  id
})
